#include "ObjectUser.h"
#include "Global.h"

namespace RisingStar
{

	CObjectUser::CObjectUser(TObjectProperty objPropert):CObject(objPropert)
	{		
		Init();
	}
	
	CObjectUser::CObjectUser()
	{
		Init();
	}
	
	CObjectUser::~CObjectUser()
	{

		
	}
	
	CObject::ObjectPtr CObjectUser::Copy()
	{
		//cout<<"CObjectUser Copy"<<endl;
		
		ObjectPtr pUser(new CObjectUser(mObjectProperty));
		*pUser = (*this);

		return pUser;
	}
	
	bool CObjectUser::Init()
	{
		nValues["对象类型"] = "用户";
		nValues["数据库类型"] = "手机";
		sGlobal.RequestCallbackMap["用户注册"] = CObjectUser::ObjectCallbackUserRegister;
		sGlobal.RequestCallbackMap["用户修改"] = CObjectUser::ObjectCallbackUserEdit;
		sGlobal.RequestCallbackMap["密码重置并登录"] = CObjectUser::ObjectCallbackUserPasswordResetAndLogin;
		sGlobal.RequestCallbackMap["密码登录"] = CObjectUser::ObjectCallbackUserPasswordLogin;
		sGlobal.RequestCallbackMap["用户验证码发送"] = CObjectUser::ObjectCallbackUserIdentifyingCodeSend;
		sGlobal.RequestCallbackMap["用户删除"] = CObjectUser::ObjectCallbackUserDel;
		return true;
	}
	
	bool CObjectUser::ObjectCallbackUserRegister(CObject* obj)
	{
		cout<<"用户注册函数调用成功"<<endl;
		return true;
	}
	bool CObjectUser::ObjectCallbackUserEdit(CObject* obj)
	{
		//cout<<"用户修改函数调用成功"<<endl;
		ObjectCallbackSqlEdit(obj);
		return true;
	}
	
	bool CObjectUser::ObjectCallbackUserDel(CObject* obj)
	{
		ObjectCallbackSqlDel(obj);

		return true;
	}
	
	
	
	bool CObjectUser::ObjectCallbackUserPasswordResetAndLogin(CObject* obj)
	{
		
		ObjectCallbackSqlAddOrEdit(obj);
		
		
		
		cout<<"密码重置并登录"<<endl;
		return true;
	}
	
	bool CObjectUser::ObjectCallbackUserPasswordLogin(CObject* obj)
	{
		
		
		cout<<"密码登录"<<endl;
		return true;
	}
	
	bool CObjectUser::ObjectCallbackUserIdentifyingCodeSend(CObject* obj)
	{
		cout<<"用户验证码发送"<<endl;
		return true;
	}
	
	
	
}

